package com.stx.threeGrup.service.impl;

import com.stx.threeGrup.mapper.LoveBokeMapperM;
import com.stx.threeGrup.mapper.automapper.LoveBokeMapper;
import com.stx.threeGrup.model.automodel.LoveBoke;
import com.stx.threeGrup.service.LoveBokeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2019/6/12
 */
@Service
public class LoveBokeServiceimpl implements LoveBokeService {

    @Autowired
    private LoveBokeMapperM loveBokeMapperM;
    @Autowired
    private LoveBokeMapper  loveBokeMapper;

    @Override
    public List<LoveBoke> queryNewsAll() {
        return loveBokeMapperM.queryNewsAll();
    }

    @Override
    public LoveBoke queryNewsById(Integer loveBokeId) {
        return loveBokeMapper.selectByPrimaryKey(loveBokeId);
    }

    @Override
    public boolean delNewById(Integer loveBokeId) {
        return loveBokeMapper.deleteByPrimaryKey(loveBokeId) > 0 ? true : false;
    }

    @Override
    public boolean updateNewById(Integer loveBokeId) {
        return false;
    }

    @Override
    public List<LoveBoke> queryNewAllById(Integer userId) {
        return loveBokeMapperM.queryNewAllById(userId);
    }

    @Override
    public boolean delNewByUserIdAndNesId(LoveBoke loveBoke) {
        return loveBokeMapperM.delNewById(loveBoke) > 0 ? true : false;

    }

    @Override
    public boolean addNewByUserId(LoveBoke loveBoke) {
        return loveBokeMapperM.addNew(loveBoke) > 0 ? true : false;
    }

}
